package pers.sen.search.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Jason
 * @version 1.0.0
 * @date 2020/11/24 21:51
 * @Description TODO
 */
@Configuration
public class ESClientConfig {

    @Bean
    public RestHighLevelClient restHighLevelClient(){
        //创建Rest客户端
        return new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("118.31.9.220", 9200, "http")
                )
        );
    }

}
